package com.wantupai.mvp.framework.base.adapter;

import android.content.Context;

import com.wantupai.mvp.framework.base.adapter.viewholder.SmartViewHolder;

/**
 * @author :Created by zhangqing on 2018/5/22 13:15.
 * @description :
 * @email :1423118197@qq.com
 * @classpath : cn.doolii.mvp.framework.base.adapter.CommonAdapter
 */
public abstract class CommonAdapter<T> extends BaseRecyclerAdapter<T>
{

    public CommonAdapter(Context context, final int layoutId)
    {
        super(context);
        addItemViewDelegate(new BaseItemDelegate<T>(context, layoutId)
        {
            @Override
            public boolean isForViewType(T item, int position)
            {
                return true;
            }

            @Override
            public void convert(SmartViewHolder holder, T t, int position)
            {
                CommonAdapter.this.convert(holder, t, position);
            }
        });
    }

    protected abstract void convert(SmartViewHolder viewHolder, T item, int position);


}
